<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            list-style: none;
        }
        
        .header {
            margin-bottom: 20px;
            width: 300px;
            height: 50px;
            background-color: tan;
            display: flex;
        }
        
        .l,
        .r {
            width: 50px;
            height: 50px;
            background-color: skyblue;
            text-align: center;
            line-height: 50px;
            font-family: "宋体";
        }
        
        .c {
            flex: 1;
            text-align: center;
            line-height: 50px;
        }
        
        .c ul {
            display: flex;
            justify-content: space-around;
        }
    </style>
</head>

<body>
    <div id="app">
        <my-header></my-header>
    </div>
</body>

<template id="tmpl">
    <div class="header">
        <div class="l">&lt;</div>
        <div class="c">
            <input type="text" placeholder="输入搜索内容">
            <h3>购物车</h3>
            <ul>
                <li>评价</li>
                <li>详情</li>
                <li>推荐</li>
            </ul>
            <slot name="center"></slot>
        </div>
        <div class="r">...</div>
    </div>
</template>

<script>
    let myHeader = {
        template: '#tmpl'
    }

    var vm = new Vue({
        el: '#app',
        data: {},
        components: {
            myHeader
        }
    })
</script>

</html>